//
//  ProtocolViewController.swift
//  FastDevelop
//
//  Created by IOS1 on 2025/6/30.
//

import UIKit

class ProtocolViewController: BaseViewController {

    //1:用户协议 2.隐私协议
    var type: Int = 1 {
        didSet{
            if type == 1 {
                titleLabel.text = "Benutzervereinbarung"
                contentLabel.text = "ZentriNot User Agreement Welcome to ZentriNot (hereinafter referred to as ZentriNot). Before using the App, please carefully read the following User Agreement (hereinafter referred to as Agreement), as it will have legal binding effects on your use of the App. 1. Acceptance of Agreement By registering, logging in, or otherwise using the App, you agree to abide by the terms and conditions of this Agreement. If you do not agree with any part of this Agreement, please refrain from using the App. 2. User Account You are required to create an account in the App to use its full features. You agree to provide accurate and complete personal information and to keep this information updated. You are responsible for maintaining the confidentiality of your account and password. If you notice any unauthorized use, you must notify us immediately. 3. Services Provided ZentriNot provides a date-based text recording and reminder feature that allows you to record texts based on dates and receive reminders at the specified time. The App is not responsible for the content and data you upload. You agree to be responsible for your actions and guarantee that all submitted content does not violate any laws or regulations. 4. Privacy Policy The App is committed to protecting your privacy. The information we collect is limited to what is necessary to provide our services, and we will not sell your personal information to third parties. We may collect usage data to improve the services, such as device information and usage time. Please refer to our Privacy Policy for more details. 5. Usage Terms Users must comply with all applicable laws and regulations and may not use the App for any illegal activities. You agree not to interfere with, disrupt, or modify the normal operation of the App in any way. We reserve the right to modify or suspend the services of the App at any time without prior notice. 6. Intellectual Property All content in the App, including but not limited to text, images, software, interfaces, logos, etc., is protected by copyright, trademark, and other intellectual property laws. You may not copy, modify, distribute, display, or sell any part of the App without authorization. 7. Disclaimer The services provided by the App are offered as-is, and we do not guarantee that the services will be uninterrupted or error-free. ZentriNot is not liable for any direct, indirect, incidental, special, or consequential damages resulting from your use of the App. 8. Termination of Service We reserve the right to terminate or suspend your account and access to the App at any time, particularly if you violate the terms of this Agreement. 9. Governing Law and Dispute Resolution This Agreement is governed by and construed in accordance with the applicable laws of the jurisdiction where we are located. Any disputes arising from or related to this Agreement shall be submitted to the courts in our jurisdiction for resolution. 10. Contact Information If you have any questions or suggestions about this Agreement, please contact us at: Email: baiyan11257@icloud.com 11. Modifications to the Agreement We reserve the right to modify this Agreement at any time. The modified Agreement will be posted within the App and will take effect immediately. By continuing to use the App, you agree to the modified Agreement. "
            }else{
                titleLabel.text = "Datenschutzrichtlinie"
                contentLabel.text = "ZentriNot Privacy Policy This Privacy Policy outlines how ZentriNot (hereinafter referred to as ZentriNot) collects, uses, and protects your personal information. By using the App, you agree to the terms outlined in this policy. 1. Information We Collect We collect personal and non-personal information when you use the App, which may include: Personal Information: When you create an account or use certain features of the App, we may collect personal details such as your name, email address, and other information necessary for your account setup. Usage Information: We may collect data related to your interactions with the App, such as the device you use, your IP address, location, and activity within the App. App Usage Data: This includes how you use the App, which features you access, and the time spent using the App. 2. How We Use Your Information The information we collect is used to provide and improve the App's functionality. Specifically, we use your information to: Create and manage your account. Provide personalized features, including reminders, notifications, and text storage. Improve the functionality, performance, and user experience of the App. Communicate with you regarding updates, support, or changes to the App. 3. How We Protect Your Information We are committed to ensuring the security of your personal information. We use a variety of security measures to protect your data, including encryption and secure servers. However, please note that no method of electronic transmission or storage is completely secure, and we cannot guarantee absolute security. 4. Sharing Your Information We do not sell, trade, or otherwise transfer your personal information to third parties without your consent, except in the following cases: Service Providers: We may share your information with third-party service providers who assist in the operation of the App, such as cloud storage services. These providers are bound by confidentiality agreements and are only permitted to use your information for specific services. Legal Compliance: We may disclose your information to comply with legal obligations, such as responding to subpoenas, court orders, or other legal processes. 5. Your Rights You have the right to access, update, or delete your personal information stored in the App. If you wish to exercise any of these rights, please contact us at baiyan11257@icloud.com. You also have the option to withdraw your consent at any time. Please note that withdrawing consent may impact your ability to use certain features of the App. 6. Data Retention We will retain your personal information for as long as your account is active or as necessary to provide you with the services you have requested. Once your account is terminated or you request the deletion of your data, we will take steps to delete or anonymize your personal information, subject to legal retention requirements. 7. Children's Privacy The App is not intended for children under the age of 13. We do not knowingly collect personal information from children. If we become aware that we have collected personal information from a child under 13, we will take steps to delete that information immediately. 8. Changes to This Privacy Policy We reserve the right to update or modify this Privacy Policy at any time. Any changes to this policy will be posted in the App, and the updated policy will become effective as soon as it is posted. By continuing to use the App after such changes, you agree to the updated Privacy Policy. 9. Contact Us If you have any questions or concerns about this Privacy Policy or the way your data is handled, please contact us at: Email: baiyan11257@icloud.com "
            }
        }
    }
    
    private let scrollView = UIScrollView()
    private let containerView = UIView()
    
    override func viewDidLoad() {
        super.viewDidLoad()

        view.addSubviews([
            titleLabel,
            backButton,
            scrollView
        ])
        scrollView.addSubview(containerView)
        containerView.addSubviews([
            contentLabel
        ])
        
        backButton.snp.makeConstraints { make in
            make.leading.equalToSuperview()
            make.top.equalToSuperview().offset(CGFloat.statusHeight)
            make.width.equalTo(56)
            make.height.equalTo(44)
        }
        titleLabel.snp.makeConstraints { make in
            make.leading.trailing.equalToSuperview()
            make.top.equalToSuperview().offset(CGFloat.statusHeight)
            make.height.equalTo(44)
        }
        scrollView.snp.makeConstraints { make in
            make.leading.bottom.equalToSuperview()
            make.width.equalTo(CGFloat.screenWidth)
            make.top.equalToSuperview().offset(CGFloat.navi_height)
        }
        containerView.snp.makeConstraints { make in
            make.leading.bottom.top.equalToSuperview()
            make.width.equalTo(CGFloat.screenWidth)
        }
        contentLabel.snp.makeConstraints { make in
            make.trailing.equalToSuperview().offset(-16)
            make.leading.equalToSuperview().offset(16)
            make.top.equalToSuperview().offset(10)
            make.bottom.equalToSuperview().offset(-10)
        }
    }
    
    @objc private func clickBackButton(){
        self.navigationController?.popViewController(animated: true)
    }
    
    private lazy var backButton: UIButton = {
        let v = UIButton(type: .custom)
        v.setImage(UIImage(named: "black_back"), for: .normal)
        v.addTarget(self, action: #selector(clickBackButton), for: .touchUpInside)
        return v
    }()
    
    private lazy var titleLabel: UILabel = {
        let v = UILabel()
        v.textColor = .black
        v.font = UIFont.boldSystemFont(ofSize: 18)
        v.textAlignment = .center
        return v
    }()
    
    private lazy var contentLabel: UILabel = {
        let v = UILabel()
        v.textColor = UIColor(hexString: "#8A8B8D")
        v.font = UIFont.systemFont(ofSize: 15)
        v.numberOfLines = 0
        return v
    }()
}
